#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>

int Fun(int n,int num)
{
	if (n == 1)
	{
		return num;
	}
	else
	{
		return num * Fun(n - 1, num);
	}
}

int main()
{
	int n = 0;
	int num = 0;
	int ret = 0;
	scanf("%d %d", &n, &num);
	ret = Fun(n, num);
	printf("%d", ret);
	return 0;
}